import os
from imgInfo2json import processYesterday
from plotImageParm import plotOneDay

def doProcess():
    
    JSON_OUTPUT_DIR = "/data/vxpp_info/L1X/imgInfo"
    IMG_CURVE_OUTPUT_DIR = "/data/vxpp_info/L1X/imgInfo_curve"
    
    delayDay = 3
    for deltaDay in range(1,delayDay):
        json_path, today_str = processYesterday(deltaDay)
        if len(json_path)>0:
            year = today_str[:4]
            json_file = json_path.split('/')[-1]
            srcPath = os.path.join(JSON_OUTPUT_DIR, year)
            
            save_dir = os.path.join(IMG_CURVE_OUTPUT_DIR, year)
            plotOneDay(json_file, srcPath, save_dir)
    
if __name__ == "__main__":
    doProcess()